var a = getApp();

Page(function(a, t, o) {
    return t in a ? Object.defineProperty(a, t, {
        value: o,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : a[t] = o, a;
}({
    data: {
        goodsList: [],
        page: 1,
        limit: 10,
        hasMore: !0,
        baseUrl: a.globalData.baseUrl
    },
    onLoad: function(t) {
        var o = a.globalData.urlBase + a.globalData.urlGoodsList;
        this.getinitData(o);
    },
    getinitData: function(t) {
        var o = this;
        o.data.hasMore && wx.request({
            url: t,
            data: {
                page: o.data.page,
                limit: o.data.limit,
                storeId: a.globalData.storeId
            },
            method: "POST",
            header: {
                "content-type": "application/x-www-form-urlencoded"
            },
            success: function(a) {
                var t = JSON.parse(a.data);
                console.log(t);
                if (0 == t.code) {
                    var e = o.data.page, n = o.data.goodsList;
                    t.goodsList.length < o.data.limit ? o.setData({
                        goodsList: n.concat(t.goodsList),
                        hasMore: !1,
                        page: e + 1
                    }) : o.setData({
                        goodsList: n.concat(t.goodsList),
                        hasMore: !0,
                        page: e + 1
                    });
                }
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
}, "onReachBottom", function() {
    var t = a.globalData.urlBase + a.globalData.urlGoodsList;
    this.getinitData(t);
}));